<?php

class IndexCTR extends Controller
{
    private $config;
    function init()
    {
        $ConfigModel = new Model('config');
        $config = $ConfigModel->fetch();
        $this->config = $config;
        $this->assign('config', $config);
    }

    function index()
    {
        $ForumModel = new Model('forum');
        $forums = $ForumModel->fetchAll();
        $AnnouncementModel = new Model('announcement');
        $this->assign('announcements', $AnnouncementModel->fetchAll());
        $this->assign('forums', $forums);
        $login_user = Session::get('user');
        $this->assign('title', $this->config['title']);
        $this->assign('login_user', $login_user);
        $this->display();
    }
}


?>